/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #4CAF50;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    font-weight: normal;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

/* 用户中心样式 */
.user-dashboard {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.user-dashboard h2 {
    margin-bottom: 20px;
    color: #4CAF50;
}

.dashboard-cards {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.dashboard-cards .card {
    flex: 1;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.dashboard-cards .card h3 {
    margin-bottom: 10px;
    color: #333;
}

/* 商品列表样式 */
.product-list-container {
    display: flex;
    gap: 30px;
}

.category-filter {
    flex: 0 0 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.category-filter h3 {
    margin-bottom: 15px;
    color: #333;
}

.category-filter ul {
    list-style-type: none;
}

.category-filter ul li {
    margin-bottom: 10px;
}

.category-filter ul li a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.category-filter ul li a:hover {
    background-color: #f0f0f0;
}

.category-filter ul li a.active {
    background-color: #4CAF50;
    color: white;
}

.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-item a {
    display: block;
    text-decoration: none;
    color: #333;
}

.product-image {
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image {
    font-size: 24px;
    color: #999;
}

.product-item h3 {
    padding: 15px;
    font-size: 18px;
    font-weight: normal;
}

.product-price {
    padding: 0 15px 10px;
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
}

.product-description {
    padding: 0 15px 15px;
    color: #666;
    font-size: 14px;
}

/* 商品详情样式 */
.product-detail {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.product-detail-content {
    display: flex;
    gap: 30px;
}

.product-detail-image {
    flex: 0 0 400px;
    height: 400px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-info {
    flex: 1;
}

.product-detail-info h2 {
    margin-bottom: 20px;
    color: #333;
}

.product-detail-price {
    font-size: 28px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-detail-barcode,
.product-detail-category,
.product-detail-stock {
    margin-bottom: 10px;
    color: #666;
}

.product-detail-description {
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.product-detail-description h3 {
    margin-bottom: 15px;
    color: #333;
}

.product-detail-actions {
    margin-top: 30px;
}

/* 页脚样式 */
footer {
    margin-top: 50px;
    padding: 30px 0;
    text-align: center;
    background-color: #333;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-cards {
        flex-direction: column;
    }
    
    .product-list-container {
        flex-direction: column;
    }
    
    .category-filter {
        flex: 1;
    }
    
    .product-detail-content {
        flex-direction: column;
    }
    
    .product-detail-image {
        flex: 1;
        height: 300px;
    }
}